#pragma once
#include <memory>
#include <string>
#include <functional>
#include "field.hpp"

namespace rpc
{
    class BaseMessage
    {
    public:
        using ptr = std::shared_ptr<BaseMessage>;
        virtual ~BaseMessage() {}
        virtual void Setid(const std::string& id) { _rid = id; }
        virtual std::string Rrid() { return _rid; }
        virtual void SetType(const MType& mtype) { _mtype = mtype; }
        virtual MType Rmtype() { return _mtype; }
        virtual std::string Serialize() = 0;
        virtual bool unserialize(const std::string& msg) = 0;
        virtual bool check() = 0;
    private:
        MType _mtype;
        std::string _rid;
    };
    class BaseBuffer
    {
    private:
        
    }
}